Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create op-simulator as basic proxy #33

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

tremarkley
Copy link
Contributor

@tremarkley tremarkley commented Jul 8, 2024

Closes #16

This PR makes the following changes:

  • creates op_simulator package
  • sets up op_simulator for each chain as a ReverseProxy that intercepts all rpc requests and forwards them to the underlying anvil node for that chain
  • coordinates starting and stopping of all op_simulator and anvil instances using the supersim package

@tremarkley
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tremarkley and the rest of your teammates on Graphite Graphite

@tremarkley tremarkley changed the title feat: create op-simulator feat: create initial version of op-simulator Jul 8, 2024
@tremarkley tremarkley changed the title feat: create initial version of op-simulator feat: create op-simulator basic proxy Jul 8, 2024
@tremarkley tremarkley changed the title feat: create op-simulator basic proxy feat: create op-simulator as basic proxy Jul 8, 2024
@tremarkley tremarkley force-pushed the harry/op-simulator branch 2 times, most recently from efda568 to 06f4cd4 Compare July 8, 2024 23:34
@tremarkley tremarkley marked this pull request as ready for review July 8, 2024 23:37
@tremarkley tremarkley requested a review from a team as a code owner July 8, 2024 23:37
@tremarkley tremarkley force-pushed the harry/op-simulator branch 6 times, most recently from 762d86b to 5c0d8af Compare July 9, 2024 16:58
@tremarkley tremarkley force-pushed the harry/op-simulator branch from 5c0d8af to 39f92ae Compare July 9, 2024 17:01
}

type Supersim struct {
log log.Logger

l1Chain *anvil.Anvil
l2Chains map[uint64]*anvil.Anvil
l1Anvil *anvil.Anvil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

In order to simplify the changes in this file, I wonder if we should simply have OpSimulator manage the lifecycle of the the underlying chain, in this case anvil. So that we dont need reference to each individual pieces here

Not worth addressing in the PR. Just some food for thought for ways to clean up this code in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I wont address in this PR, since I want to keep this change small.

If we want to stick to the original design, we should create an Orchestrator service that handles spinning up all the anvil instances and OpSimulator instances.

@tremarkley tremarkley force-pushed the harry/op-simulator branch from 39f92ae to 7247db8 Compare July 9, 2024 17:39
@tremarkley tremarkley force-pushed the harry/op-simulator branch from 7247db8 to f2cc9a8 Compare July 9, 2024 17:47
@tremarkley tremarkley merged commit a30767b into main Jul 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

op-simulator: basic proxy
3 participants